package com.version.manager.service.Shop;

import com.version.manager.entity.Shop.shopCategory;
import com.version.manager.mapper.Shop.shopCategoryMapper;
import com.version.manager.model.Msg;
import com.version.manager.service.BaseService;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.logging.Logger;

@Service
@Transactional(rollbackFor = Exception.class)
public class shopCategoryService extends BaseService<shopCategoryMapper, shopCategory> {

    private static org.slf4j.Logger logger= LoggerFactory.getLogger(shopCategoryService.class);
    public Msg save(shopCategory data){
        try{
            return super.saveOrUpdate(data);

        }catch (Exception ex){
            logger.error(ex.getMessage());
            return Msg.fail().addMessage(ex.getMessage());
        }
    }

    public Msg all(){
        try{
            return Msg.success();
        }catch (Exception ex){
            return Msg.fail();
        }
    }
}
